<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>表单的手动提交</title>
    <script type="text/javascript">
        //实现表单提交
        function method01(){
            //步骤1：获取表单标签对象
            var forElement=document.getElementById('myform');
            //步骤2：设置表单对象属性
            forElement.method='post';
            forElement.action='js02_01_01.html';
            //步骤3：实现表单提交
            forElement.submit();
        }
       /* function method01(){
            //步骤1：获取表单标签对象
           var forElement=document.getElementById('myform');
            //步骤2：设置表单对象属性
            //步骤3：实现表单提交
            with (forElement){
                method01='post';
                action='js02_01_01.html';
                submit();
            }
        }*/
    </script>
</head>
<body>
<form id="myform">
    用户名：<input type="text"><br>
    密&nbsp;&nbsp;&nbsp;码：<input type="password"><br>
    <input type="button" value="提交" onclick="method01()">
    <input type="reset" value="重置">
</form>
</body>
</html>